package com.rky.spring.cloud.api;

import com.rky.spring.cloud.entity.Employee;
import com.rky.spring.cloud.factory.MyFallBackFactory;
import com.rky.spring.cloud.util.ResultEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author 0x_Jss
 * @date 2022年02月19日 14:50
 * @description
 */
@FeignClient(value = "rky-provider",fallbackFactory = MyFallBackFactory.class) //表示当前注解和一个Provider对应

public interface EmployeeRemoteService {

    //远程调用的接口方法

    @RequestMapping("/provider/get/employee/remote")
    public Employee getEmployeeRemote();

    @RequestMapping("/provider/get/emp/list/remote")
    public List<Employee> getEmpListRemote(@RequestParam("keyword") String keyword);

    @RequestMapping("/provider/get/emp/with/circuit/breaker")
    public ResultEntity<Employee> getEmpWithCircuitBreaker(@RequestParam("signal")String signal);
}